display binomial(10 ,6 ,.4)-binomial(10 ,5 ,.4).11147674
Probability theory and Distributions
Bongani Ncube(3002164)
2026-03-01
webr aspect to make it more interactive.A sample space Ω is defined as the set of all possible outcomes of a random experiment. For example, if we roll a 6-sided die, the sample space is the set of the six possible outcomes, \[Ω ={1, 2, 3, 4, 5, 6}\].
For each experiment, the following are true:
the sample space, Ω, which comprises all possible outcomes.
the empty set = ∅, that contains no outcomes and it is called the impossible event.
The sample space, \(\color{dodgerblue}{\Omega}\), is the set of all possible outcomes of an experiment.
An outcome, \(\color{dodgerblue}{\omega}\), is a result from an experiment or observation.
An event, \(\color{dodgerblue}{A}\), is a collection of one or more outcomes from an experiment or observation.
The union of the events A and B, denoted by A∪B, is the collection of all outcomes that are in A or in B or in both of them and it is also an event. It will occur if either A or B occurs (the symbol ∪ is equivalent to OR operator).
Example
In the experiment of rolling a die, let’s consider the events.
"the number rolled is even" and"the number rolled is less than three".The intersection of A and B, denoted by A∩B, consists of all outcomes that are in both A and B (the symbol ∩ is equivalent to AND operator). That is, the events A and B must occur simultaneously.
Example
For example, the complement of the union of A and B, denoted by \((A∪B)^c\) (sometimes denoted as \((A∪B)'\)), is also an event and consists of all outcomes of the sample space Ω that don’t belong to A∪B.
Example
Let’s consider the events
"the number rolled is even" and"the number rolled is odd".The events A and C are mutually exclusive (also known as disjoint) if they cannot occur simultaneously. This means that they do not share any outcomes and \[A∩C =∅\].
Example
The concept of probability is used in everyday life which stands for the likelihood of occurring or non-occurring of random events. The first step towards determining the probability of an event is to establish a number of basic rules that capture the meaning of probability. The probability of an event should fulfill three axioms defined by Kolmogorov:
Theoretical probability describes the behavior we expect to happen if we give a precise description of the experiment (but without conducting any experiments). Theoretically, we can list out all the equally probable outcomes of an experiment, and determine how many of them are favorable for the event A to occur. Then, the probability of an event A to occur is defined as:
\[P(A) = \frac{\textrm{Number of outcomes favourable to the event A}}{\textrm{Total number of possible outcomes}} \tag{1}\]
Note that the Equation 1 only works for experiments that are considered “fair”; this means that there must be no bias involved so that all outcomes are equally likely to occur.
Example 1
What is the theoretical probability of rolling the number “5” when we roll a six-sided fair die once?
The theoretical probability is:
\[P(\textrm{rolling 5}) = \frac{\textrm{1 outcome favourable to the event}}{\textrm{6 possible outcomes}} = \frac{1}{6} \approx 0.167\]
This is because only one outcome (die showing: ) is favorable out of the six equally likely outcomes (die showing: , , , , , ).
Example 2
What is the probability of rolling either a “5” or a “6” when we roll a six-sided fair die once?
The theoretical probability is:
\[P(\textrm{rolling 5 OR 6}) = \frac{\textrm{2 outcomes favourable to the event}}{\textrm{6 possible outcomes}} = \frac{2}{6} = \frac{1}{3}\approx 0.33\]
This is because two outcomes (die showing: or ) is favorable out of the six equally likely outcomes (die showing: , , , , , ).
We can also use the probability’s axioms. The probability of rolling a 6 is 1/6 and the probability of rolling a 5 is also 1/6. We cannot take a 5 and 6 at the same time (these events are mutually exclusive) so:
\[\textrm{P(rolling a 5 OR 6) = P(rolling a 5) + P(rolling a 6) = 1/6 + 1/6 = 2/6 = 1/3}\]
The experimental probability is based on data from repetitions of the same experiment. According to this approach, the probability of an event A, denoted by P(A), is the relative frequency of occurrence of the event over a total number of experiments:
\[ P(A) \approx \frac{\textrm{number of times A occured}}{\textrm{total number of experiments}} \tag{2}\]
The following properties are useful to assign and manipulate event probabilities.
Let \(A\) and \(B\) denote two events in sample space \(\Omega\), then
\(\color{dodgerblue}{P(A)}\) is the probability that event \(A\) occurs.
\(\color{dodgerblue}{P(A^C) = P(\bar{A}) = P(A')}\) is the probability that event \(A\) does NOT occur.
The notation \(\color{dodgerblue}{A^C}\), \(\color{dodgerblue}{\bar{A}}\), or \(\color{dodgerblue}{A'}\) are used to denote the complement of \(A\).
\(\color{dodgerblue}{P(A \cap B)}\) is the probability that events \(A\) and \(B\) both occur.
\(\color{dodgerblue}{P(A \cup B)}\) is the probability that either event \(A\) or event \(B\) occurs (or both \(A\) and \(B\) occur).
\(\color{dodgerblue}{P(B \ | \ A )}\) is the conditional probability that event \(B\) occurs given that event \(A\) occurs.
\(\color{dodgerblue}{P(A - B)}\) is the probability that event A occurs and event B does not occur.
The probability of the null event is zero, P(∅) = 0.
The probability of the complement event A satisfies the property:
\[P(A') = 1 − P(A) \tag{3}\]
\[P(A ∪ B) = P(A) + P(B) − P(A ∩ B) \tag{4}\]
The conditional probability is indicated as P(A|B) (or A given B) and the outcome of event A depends on the outcome of event B. The following formula defines the conditional probability:
\[P(A ∩ B) = P(A|B) · P(B) \tag{5}\]
or
\[ P(A|B)= \frac{P(A ∩ B)}{P(B)} \tag{6}\]
Example
Suppose we roll two fair six-sided dice. What is the probability that the first roll is a 3, given that the sum of two rolls is 8?
The sample space of the experiment consists of all ordered pairs of numbers from 1 to 6. That is, Ω = {(1, 1), (1, 2),… , (1, 6), (2, 1),… , (6, 6)}.
It is useful to define the following two events:
A = {The first roll shows 3, and the second any number}.
B = {The sum of two rolls is 8}.
We are interested in finding the conditional probability: \[P(A|B) = \frac{P(A ∩ B)}{P(B)}\]
Therefore, the probability of event A is:
\[P(A) = \frac{\textrm{6}}{\textrm{36}} =\frac{\textrm{1}}{\textrm{6}} \]
Therefore, the probability of event B to occur is:
\[P(B) = \frac{\textrm{5}}{\textrm{36}} \]
| 1st roll | 2 | \(\color{red}{3}\) | 4 | 5 | 6 |
| 2nd roll | 6 | \(\color{red}{5}\) | 4 | 3 | 2 |
| Sum | 8 | \(\color{red}{8}\) | 8 | 8 | 8 |
Thus, the probability of intersection of the two events is P(A∩B) = 1/36.
\[P(A|B) = \frac{P(A ∩ B)}{P(B)} = \frac{\frac{1}{36}}{\frac{5}{36}} = \frac{1}{5}\]
Therefore, the “knowledge” that the sum of two rolls is 8 has updated the probability of A from P(A) = 1/6 = 0.167 to P(A|B) = 1/5 = 0.2.
Bayes’ theorem is based on this concept of “revisiting probability” when new information is available.
The Equation 5 states that \(P(A ∩ B) = P(A|B) · P(B)\). Note that the \(P(A ∩ B)\) is the probability of both events A and B occurring, so we can also state that \(P(A ∩ B) = P(B|A) · P(A)\).
Now, replacing the P(A ∩ B) with P(B|A) · P(A) in the Equation 6 we get the Bayes’ theorem:
\[P(A|B) = \frac{P(B|A)· P(A)}{P(B)} \tag{7}\]
where \(P(B)\neq 0\).
Example
We are interested in calculating the probability of developing lung cancer if a person smokes tobacco for a long time, P(Cancer|Smoker).
Suppose that 8% of the population has lung cancer, P(Cancer) = 0.08, and 30% of the population are chronic smokers, P(Smoker) = 0.30. Also, suppose that we know that 60% of all people who have lung cancer are smokers, P(Smoker|Cancer) = 0.6.
Using the Bayes’ theorem we have:
\[ \textrm{P(Cancer|Smoker) = }\frac{\textrm{P(Smoker|Cancer)· P(Cancer)}}{\textrm{P(Smoker)}} = \frac{0.6 \times 0.08}{0.3}= \frac{0.048}{0.3}= 0.16\]
A partition of a space \(\Omega\) is a collection of disjoint sets such that \(\displaystyle \bigcup_{i=1}^{\infty} A_i = \Omega\).
Let \(A_1\), \(A_2\), \(\ldots , A_k\) be a partition of \(\Omega\) such that \(P(A_i)>0\) for each \(i\). If \(B\) is any event with \(P(B)>0\), then for each \(i=1, \ldots k\), we have
\[P(A_i \mid B) = \frac{P(A_i \cap B) }{P(B)} = \frac{P(B \mid A_i) P(A_i)}{\sum_{j=1}^k P(B \mid A_j)P(A_j)}.\]
If the knowledge of occurrence of an event does not influence the occurrence of another event, the two events are called independent. In fact, if A and B are independent, then the conditional probability is P(A|B) = P(A), i.e. the occurrence of B has no influence on the occurrence of A and P(B|A) = P(B), i.e. the occurrence of A has no influence on the occurrence of A. Consider, for example, rolling two dice consecutively: the outcome of the first die is independent of the outcome of the other die.
Two events A and B are said to be independent if:
\[P(A ∩ B) = P(A) · P(B) \tag{8}\]
This is known as Multiplication Rule of Probability and follows directly from Equation 5 because P(A|B) = P(A).
Example
Determine the probability of obtaining two 3s when rolling two six-sided fair dice consecutively. This event can be decomposed in two events:
\[P(A) = \frac{\textrm{6}}{\textrm{36}} = \frac{\textrm{1 }}{\textrm{6}}\]
\[P(B) = \frac{\textrm{6}}{\textrm{36}} = \frac{\textrm{1}}{\textrm{6}}\]
We can state that the two events A and B are independent by nature, since each event involves a different die, which has no knowledge of the outcome of the other one. The event of interest is A ∩ B, and the definition of probability of two independent events leads to:
\[ {\textrm{P(A ∩ B) = P(A) · P(B) =} \frac{1}{6} · \frac{1}{6} = \frac{1}{36}}\]
This result can be verified by a direct count of all possible outcomes in the roll of two dice, and the fact that there is only one combination out of 36 that gives rise to two consecutive 3s.
A random variable assigns a numerical quantity to every possible outcome of a random phenomenon and may be:
The probability distribution of a discrete random variable X is defined by the probability mass function (pmf) as:
\[ P(X = x) = P(x) \tag{9}\]
where:
\(P(X = x)\) is the probability that the random variable X takes the value x and
\(P(x)\) is the probability of the specific outcome x occurring.
The pmf has two properties:
Additionally, the cumulative distribution function (cdf) gives the probability that the random variable X is less than or equal to x and is usually denoted as F(x):
\[F(x) = P(X \le x)= \sum_{x_i\le x} P(x_i) \tag{10}\]
where the sum takes place for all the values \(x_1, x_2, \ldots, x_i\), which are \(x_i\le x\).
The expected value or mean, denoted as E(X) or μ, is defined as the weighted average of the values that X can take on, with each possible value being weighted by its respective probability, P(x).
\(\mu = E(X)= \sum\limits_i x_i \cdot P(x_i)\)
We can also define the variance, denoted as \(\sigma^2\), which is a measure of the variability of the X.
\(\sigma^2=\text{Var}(X)= E[X - E(X)]^2 = E[(X - \mu)^2] = \sum\limits_i\ (x_i-\mu)^2 P(x_i)\)
There is an easier form of this formula.
\(\sigma^2=\text{Var}(X)= E(X^2) - E(X)^2=\sum\limits_i x_i^2 P(x_i)-\mu^2\)
The standard deviation is the square root of the variance.
\(\sigma=\sqrt{\text{Var(X)}}=\sqrt{\sigma^2}\)
A random experiment with two possible outcomes, generally referred to as success (x = 1) and failure (x = 0), is called a Bernoulli trial.
Let X be a binary random variable of a Bernoulli trial which takes the value 1 (success) with probability p and 0 (failure) with probability 1-p. The distribution of the X variable is called Bernoulli distribution with parameter p, denoted as \(X ∼ Bernoulli(p)\), where \({0\leq p\leq 1}\).
\[P(X=x)={\begin{cases}1-p,&for\ x=0\\p,&for\ x=1\end{cases}} \tag{11}\]
which can also be written as: \[P(X=x)=p^{x}(1-p)^{1-x}\quad {\text{for }}x\in \{0,1\} \tag{12}\]
\[F(x) = P(X \le x)= {\begin{cases}0,&for\ x <0\\1-p,&for\ 0\leq x < 1\\1,&for\ x \geq 1 \end{cases}} \tag{13}\]
The random variable X can take either value 0 or value 1. If \(x<0\), then \(P(X \le x) = 0\) because X can not take values smaller than 0. If \(0\leq x < 1\), then \(P(X \le x) = P(X=0) = 1-p\). Finally, if \(x \geq 1\), then \(P(X \le x) = P(X = 0) + P(X = 1) = (1 - p) + p = 1\).
The expected value of random variable, X, with Bernoulli(p) distribution is:
\[μ = E(X)= p \tag{14}\]
\(E(X) = \sum_{i=1}^{2}x_iP(x_i) = 0 \cdot P(X=0) + 1 \cdot P(X=1) = p\)
The variance is:
\[\sigma^2 = Var(X) = p(1-p) \tag{15}\]
\(Var(X) = \sum_{i=1}^{2}x_iP(x_i) - \mu^2= 0 \cdot P(X=0) + 1 \cdot P(X=1) - p^2= p (1-p)\)
and the standard deviation is:
\[ σ = \sqrt{Var(X)} = \sqrt{p(1-p)} \tag{16}\]
Example
Let X be a random variable representing the result of a surgical procedure, where X = 1 if the surgery was successful and X = 0 if it was unsuccessful. Suppose that the probability of success is 0.7; then X follows a Bernoulli distribution with parameter p = 0.7: \(X ∼ Bernoulli(0.7)\).
Find the main characteristics of this distribution.
\[P(X=x)={\begin{cases}0.3,&for\ x=0\\0.7,&for\ x=1\end{cases}} \tag{17}\]
According to Equation 17 we have:
| X | 0 | 1 |
| P(X) | 0.3 | 0.7 |
The binomial probability distribution can be used for modeling the number of times a particular event occurs (successes) in a sequence of n repeated and independent Bernoulli trials, each with probability p of success.
Let X be a random variable that indicates the number of successes in n-independent Bernoulli trials. If random variable X satisfies the binomial setting, it follows the binomial distribution with parameters n and p, denoted as \(X ∼ Binomial(n, p)\), where n is the Bernoulli trial parameter (a positive integer) and p the Bernoulli probability parameter (\({0\leq p\leq 1}\)).
\[ P(X=x) = {{n}\choose{x}} \cdot p^x \cdot (1-p)^{n-x} \tag{18}\]
where x = 0, 1, … , n and \(\binom{n}{x} = \frac{n!}{x!(n-x)!}\)
Note that: \(n! = 1\cdot 2 \cdot 3\cdot \ldots \cdot (n-2)\cdot (n-1)\cdot n\)
\[F(x) = P(X \le x)= {\begin{cases}0,&for\ x <0\\\sum_{k=0}^{x}{\left( \begin{array}{c} n \\ k \end{array} \right) p^{k}(1 - p)^{n-k}},&for\ 0\leq x < n\\1,&for\ x \geq n \end{cases}} \tag{19}\]
The mean of random variable, X, with Binomial(n, p) distribution is:
\[μ = np \tag{20}\]
the variance is:
\[σ^2 = np(1-p) \tag{21}\]
and the standard deviation:
\[σ = \sqrt{np(1-p)} \tag{22}\]
Example
Let the random variable X be the number of successful surgical procedures and suppose that a new surgery method is successful 70% of the time (p = 0.7). If the results of 10 surgeries are randomly sampled, and X follows a Binomial distribution \(X ∼ Binomial(10, 0.7)\), find the main characteristics of this distribution.
\[ P(X=x) = {{10}\choose{x}} \cdot 0.7^x \cdot (1-0.7)^{10-x} \tag{23}\]
The pmf of Binomial(10, 0.7) distribution specifies the probability of 0 through 10 successful surgical procedures.
According to Equation 23 we have:
| X | 0 | 1 | 2 | 3 | … | 8 | 9 | 10 |
| P(X) | 0 | 0.0001 | 0.0014 | 0.009 | … | 0.233 | 0.121 | 0.028 |
In R, the we can use the functions:
dbinom(x, n, p) calculates the probability of exactly \(x\) successes out \(n\) trials, \(\color{dodgerblue}{p(x)=P(X=x)}\).pbinom(x, n, p) calculates the probability of at most \(x\) successes out \(n\) trials, \(\color{tomato}{F(x)=P(X \leq x)}\).rbinom(m, n, p) randomly sample \(m\) values from \(X \sim \mbox{Binom}(n, p)\) (with replacement).qbinom(q, n, p) compute the qth quantile.We can easily compute the above probabilities using the dbinom() function in R:
Let’s calculate the probability of having having more than 8 successful surgical procedures out of a total of 10. Therefore, we want to calculate the probability P(X > 8):
\[ P(X > 8)= P(X = 9) + P(X = 10) = {{10}\choose{9}} \cdot 0.7^9 \cdot 0.3^1 + {{10}\choose{10}} \cdot 0.7^{10} \cdot 0.3^0 \Rightarrow \]
\[ P(X > 8)= 10 \cdot 0.04035 \cdot 0.3 + 1 \cdot 0.02824 = 0.12105 + 0.02825 = 0.1493\]
In R, we can calculate the probabilities P(X = 9) and P(X = 10) by applying the function dbinom() and adding the results:
Of note, another way to find the above probability is to calculate the 1-P(X ≤ 8):
\[P(X=x) = \binom{N}{x}p^x(1-p)^{N-x}\]
| \(x\) | \(P(X=x)\) |
|---|---|
| 0 | \((1-p)^N\) |
| 1 | \(Np(1-p)^{N-1}\) |
| … | … |
| N | \(p^N\) |
Let’s say \(X \sim \text{Bin}(N=10,p=0.5)\) is a random variable counting the number of males. What is the probability of having at most 1 male?
\(N=4,p=\frac{4}{5}\)
\[P(X>2)= P(X=3)+P(X=4)+P(X=5)+...\]
which is generally
\[P(X>2)=1-P(X \leq 2)=1-(P(X=0)+P(X=1)+P(X=2))\] which is equal to
\[\binom{4}{0}\frac{4}{5}^0(1-\frac{4}{5})^{4-0}+\binom{4}{1}\frac{4}{5}^1(1-\frac{4}{5})^{4-1}+\binom{4}{2}\frac{4}{5}^2(1-\frac{4}{5})^{4-2}\]
\[P(X>=3)= P(X=3)+P(X=4)+P(X=5)+...\]
same as above
Fortunately, R has this pre-programmed dbinom(x , size , prob )
\[P(X=6) = \binom{10}{6}\frac{2}{5}^6(1-\frac{2}{5})^{10-6}\]
rbinom, dbinomContext: Number of occurrences of an event over a given unit of space or time.
\(X \sim \text{Poisson}(\lambda)\) with \(\lambda\) expected number of occurrences
\[P(X=x) = {{e^{-\lambda}\lambda^x}\over{x!}}\]
Example: \(X\) is the random variable number of birds counted on a colony during the breeding season
While a random variable with a Binomial distribution describes a count variable (e.g., number of successful surgeries), its range is restricted to whole numbers from 0 to n. For example, in a set of 10 surgical procedures (n = 10), the number of successful surgeries cannot surpass 10.
Now, let’s suppose that we are are interested in the number of successful surgeries per month in a particular specialty within a hospital. Theoretically, in this case, it is possible for the values to extend indefinitely without a predetermined upper limit.
Therefore, using the Poisson distribution, we can estimate the probability of observing a certain number of successful surgeries in a given month.
Let X be a random variable that indicates the number of events (occurrences) that happen within a fixed interval of time or space. If \(λ\) represents the average rate of events (occurrences) in this interval or space, the X has a Poisson distribution that is specified by the parameter \(λ\), denoted as \(X ∼ Poisson(λ)\), where \(λ\) is a positive real number (\(λ >0\)).
\[ P(X=x)={\frac {\lambda ^{x}e^{-\lambda }}{x!}} \tag{24}\]
where x = 0, 1, … +∞, λ > 0.
\[F(x) = P(X \le x)= {\begin{cases}0,&for\ x <0\\\sum_{k=0}^{x}{ \begin{array}{c} \frac {\lambda ^{k}e^{-\lambda }}{k!} \end{array}},&for\ x\geq 0 \end{cases}} \tag{25}\]
The mean and variance of a random variable that follows the Poisson(λ) distribution are the same and equal to λ:
Example
Let X be a random variable of the number of successful heart transplant surgeries per week in a specialized cardiac center. We assume that the average rate of successful surgeries per week is 2.5 (\(λ = 2.5\)), and X follows a Poisson distribution: \(X ∼ Poisson(2.5)\)
\[ P(X=x)={\frac {2.5 ^{x}e^{-2.5 }}{x!}} \]
The resulting probability table is:
| X | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | … |
| P(X) | 0.082 | 0.205 | 0.257 | 0.214 | 0.134 | 0.067 | 0.028 | 0.01 | 0.003 | … |
We can compute the above probabilities using the dpois() function in R:
\[P(X=x) = {{e^{-\lambda}\lambda^x}\over{x!}}\]
| \(x\) | \(P(X=x)\) |
|---|---|
| 0 | \(e^{-\lambda}\) |
| 1 | \(\lambda e^{-\lambda}\) |
| … | … |
Example: A small town’s police department issues 5 speeding tickets per month on average. Using a Poisson random variable, what is the likelihood that the police department issues 3 or fewer tickets in one month?
First, we note that here \(P(Y \le 3) = P(Y=0) + P(Y=1) + \cdots + P(Y=3)\). Applying the probability mass function for a Poisson distribution with \(\lambda = 5\), we find that
\[\begin{aligned} P(Y \le 3) &= P(Y=0) + P(Y=1) + P(Y=2) + P(Y=3) \\ &= \frac{e^{-5}5^0}{0!} + \frac{e^{-5}5^1}{1!} + \frac{e^{-5}5^2}{2!} + \frac{e^{-5}5^3}{3!}\\ &= 0.27. \end{aligned}\]
We can verify through R:
Therefore, there is a 27% chance of 3 or fewer tickets being issued within one month.
rpois, dpoisA normal distribution, also known as a Gaussian distribution, is a fundamental concept in statistics and probability theory and is defined by two parameters: the mean (\(μ\)) and the standard deviation (\(σ\)) .
\[ f(x)={\frac {1}{\sigma {\sqrt {2\pi }}}}e^{-{\frac {1}{2}}\left({\frac {x-\mu }{\sigma }}\right)^{2}} \tag{26}\]
where \(\pi \approx 3.14\) and \(e \approx 2.718\).
\[ F(x_o) = P(X\leq x_o)={\frac {1}{\sigma {\sqrt {2\pi }}}} \int_{- \infty }^{x_o}e^{-{\frac {1}{2}}\left({\frac {x-\mu }{\sigma }}\right)^{2}}dx \tag{27}\] where \(-\infty \leq x_o \leq + \infty\)
Example
Let’s say that in a population the random variable of height, X, for adult people approximates a normal distribution with a mean μ = 170 cm and a standard deviation σ = 10 cm.
The pdf for this distribution is shown below:
Let’s assume that we want to calculate the area under the curve between 160 cm and 180 cm, that is:
\[ P(160\leq X \leq 180)=\int_{160}^{180}f(x)dx \]
Using the properties of integrals we have:
\[ \int_{-\infty}^{180}f(x)dx = \int_{-\infty}^{160}f(x)dx + \int_{160}^{180}f(x)dx \] \[ \Leftrightarrow \int_{160}^{180}f(x)dx = \int_{-\infty}^{180}f(x)dx - \int_{-\infty}^{160}f(x)dx \] \[ \Leftrightarrow P(160\leq X \leq 180) = P(X \leq 180)- P(X \leq 160) \]
Therefore, one way to find the area under the curve between 160 cm and 180 cm is to calculate the cdf at each of these values and then find the difference between them:
\[ P(X \leq 180)=\int_{-\infty}^{180}f(x)dx \]
\[ P(X \leq 160)=\int_{-\infty}^{160}f(x)dx \]
Finally, we subtract the two values (shaded blue areas) as follows:
If X is a random variable with a normal distribution having a mean of \(\mu\) and a standard deviation of \(\sigma\), then the standardized Normal deviate can be expressed as:
\[ z= \frac{x-\mu}{\sigma} \tag{28}\]
The z (often called z-score) is a random variable that has a Standard Normal distribution, also called a z-distribution, i.e. a special normal distribution where \(\mu=0\) and \(\sigma^2=1\). In this case, Equation 26 is transformed as follows:
\[ f(z)={\frac {1}{{\sqrt {2\pi }}}}e^{-{\frac {1}{2}}z^2} \tag{29}\]
Z-scores are commonly used in medical settings to assess how an individual’s measurement compares to the average value of the entire population.
Example
Let’s assume that the diastolic blood pressure distribution among men has a normal distribution with mean 80 mmHg and standard deviation 15 mmHg. If an individual’s diastolic blood pressure is recorded as 110 mmHg, how many standard deviations differs from the population mean?
The z-score Equation 28 is:
\(z = \frac{(110 – 80)}{15} = 2\)
So this person has a diastolic blood pressure that is 2 standard deviations above the population mean.
To find the area under the curve between two z-scores, \(z_1\) and \(z_2\), we have to integrate the pdf Equation 29 as follows:
\[ P(z_1\leq Z\leq z_2)={\frac {1}{{\sqrt {2\pi }}}}\int_{z_1}^{z_2}e^{-{\frac {1}{2}}z^2}dz \tag{30}\]
For example, let’s calculate the area under the curve in ?@fig-z2, for \(z_1\) = 0 and \(z_2\) = 2:
In R, we can easily calculate the above area using the cdf of the normal distribution:
\[P(0\leq Z\leq 2) = P(Z\leq 2) - P(Z\leq 0)\]
rnorm, dnormExample 1: The weight of a box of Fruity Tootie cereal is approximately normally distributed with an average weight of 15 ounces and a standard deviation of 0.5 ounces. What is the probability that the weight of a randomly selected box is more than 15.5 ounces?
Using a normal distribution,
\[\begin{aligned} P(Y > 15.5) = \int_{15.5}^{\infty} \frac{e^{-(y-15)^2/ (2\cdot 0.5^2)}}{\sqrt{2\pi\cdot 0.5^2}}dy = 0.159 \end{aligned}\]
However the formula above is hard to work with hence the need to standardize and use tables.
Y into Z such that \[Z=\frac{Y-\mu}{\sigma}\]therefore we would calculate as follows
\[P(Y > 15.5)=P(Z> \frac{15.5-15}{0.5})=P(Z> 1)\]
in high school or varsity the above would be found in statistical tables such that \[P(Z>1)=1-P(Z<1)=1-\Phi(1)\]
but it is easier to do in R such that using pnorm()
We can use R with the originial values as well:
There is a 16% chance of a randomly selected box weighing more than 15.5 ounces.
example:2 Suppose IQ scores are distributed \(X \sim N\left(100, 16^2\right)\). What is the probability that a randomly selected person’s IQ is less than 90.
in R
example 3: What is the probability that a randomly selected person’s IQ is greater than 90
in R
example 3: What is the probability that a randomly selected person’s IQ is between 92 and 114.
in R
If has nice properties, such as: if \(X \sim \text{N}(\mu,\sigma^2)\), then \(Z = \displaystyle{{{X - \mu}\over{\sigma}} \sim \text{N}(0,1)}\)
It is a limiting distribution (Central Limit Theorem)
It can be a good approximation for other distributions
By the central limit theorem (CLT) the binomial distribution \(X \sim B(n,p)\) approaches the normal distribution with mean \(\mu = n p\) and variance \(\sigma^2=np(1-p)\) as \(n \rightarrow \infty\). The approximation is useful when the expected number of successes and failures is at least 5, \(np>=5\) and \(n(1-p)>=5\).
Exact binomial
Normal approximation
suppose
\(X \sim \text{Bin}(N=50,p=0.3)\)
Mean is \(Np = 50 \times 0.3 = 15\)
Variance is \(Np(1-p) = 50 \times 0.3 \times 0.7 = 10.5\)
Therefore, \(X\) can be approximated by \(Y \sim \text{N}(15,\sigma=\sqrt{10.5})\)